package com.example.studentstatusmanagement.mapper;

import com.example.studentstatusmanagement.pojo.Major;
import com.example.studentstatusmanagement.pojo.MajorExample;
import java.util.List;

import com.example.studentstatusmanagement.pojo.doo.ReqMajor;
import com.example.studentstatusmanagement.pojo.dto.MajorInfo;
import com.example.studentstatusmanagement.pojo.dto.SMajor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface MajorMapper {
    int countByExample(MajorExample example);

    int deleteByExample(MajorExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Major record);

    int insertSelective(Major record);

    List<Major> selectByExample(MajorExample example);

    Major selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Major record, @Param("example") MajorExample example);

    int updateByExample(@Param("record") Major record, @Param("example") MajorExample example);

    int updateByPrimaryKeySelective(Major record);

    int updateByPrimaryKey(Major record);


    // 查询未删除专业
    @Select("SELECT m.id ,m.major_name as name FROM major m WHERE m.isdel = 0")
    List<MajorInfo> selectMajors();

    //查询major
    List<SMajor> selectMajorsInfo(ReqMajor reqMajor);

    @Select("SELECT m.id ,m.major_name as name FROM major m where m.isdel = 0")
    List<ReqMajor> selectMajorsforClass();
}